using System;
using System.Net;
using CodePlex.TfsLibrary.ObjectModel;

namespace CodePlex.UnitTestUtility
{
    public class StubRegistrationService : IRegistrationService
    {
        public const string DownloadUrl = "http://www.fakedownurl.com/";
        public const string SccProviderUrl = "http://www.fakesccproviderurl.com/";
        public const string UploadUrl = "http://www.fakeupurl.com/";
        public ICredentials Credentials;
        public string TfsUrl;

        public string GetServiceInterfaceUrl(string tfsUrl,
                                             ICredentials credentials,
                                             string serviceType,
                                             string interfaceName)
        {
            TfsUrl = tfsUrl;
            Credentials = credentials;

            if (serviceType != "VersionControl")
                throw new ArgumentException("bad service type");

            switch (interfaceName)
            {
                case "ISCCProvider":
                    return SccProviderUrl;
                case "Download":
                    return DownloadUrl;
                case "Upload":
                    return UploadUrl;
            }

            throw new ArgumentException("bad interface name");
        }
    }
}